/*
Copyright Nicolas Dessart 2010 Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

#ifndef H_STDWORKPSACE
#define H_STDWORKPSACE

#include "workspace.h"

#define PExpression boost::shared_ptr<Expression<T> >

template <typename T>
class stdworkspace : public WorkSp<T>
{
public:
    stdworkspace()
    {
        SetFunc("pi", PExpression( new ValExpression<T>(T(3.1415926535898))));
        SetFunc("e",  PExpression( new ValExpression<T>(T(2.7182818284590))));
    }
private:

    // Forbid stdworkspace modifications (this is bullshit since WorkSp<T>::SetExpr is used everywhere, but ok...)
    const PExpression SetExpr(const std::string& name, PExpression exp)
    {
        return WorkSp<T>::SetExpr(name,exp);
    }
};

#undef PExpression

#endif // H_STDWORKPSACE
